package com.asw.springboot.controller;

import com.asw.springboot.common.CommonController;
import com.asw.springboot.common.result.GlobalErrorInfoEnum;
import com.asw.springboot.common.result.ResultBody;
import com.asw.springboot.po.City;
import com.asw.springboot.service.ICityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/city/error2")
public class CityError2ApiController extends CommonController{


    @Autowired
    private ICityService cityService;

    @RequestMapping(value = "/error1")
    public ResultBody error1(String token){
        if (StringUtils.isBlank(token)) {
            return new ResultBody(GlobalErrorInfoEnum.PARAMS_NO_COMPLETE);
        }
        ResultBody resultBody = cityService.findAllCity2();
        return resultBody;
    }

}
